home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / MotifApp / ComponentLib / UIComponent.h < prev   
Encoding:
C/C++ Source or Header  |  1995-05-03  |  2.2 KB  |  74 lines

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //////////////////////////////////////////////////////////////////////////////
  3. //         This example code is from the book:
  4. //
  5. //           Object-Oriented Programming with C++ and OSF/Motif
  6. //         by
  7. //           Douglas Young
  8. //           Prentice Hall, 1992
  9. //           ISBN 0-13-630252-1    
  10. //
  11. //         Copyright 1991 by Prentice Hall
  12. //         All Rights Reserved
  13. //
  14. //  Permission to use, copy, modify, and distribute this software for 
  15. //  any purpose except publication and without fee is hereby granted, provided 
  16. //  that the above copyright notice appear in all copies of the software.
  17. ///////////////////////////////////////////////////////////////////////////////
  18. //////////////////////////////////////////////////////////////////////////////
  19.  
  20.  
  21. ///////////////////////////////////////////////////////////////
  22. // UIComponent.h: Base class for all C++/Motif UI components
  23. ///////////////////////////////////////////////////////////////
  24. #ifndef UICOMPONENT_H
  25. #define UICOMPONENT_H
  26. #include <Xm/Xm.h>
  27. #include "BasicComponent.h"
  28.  
  29. class UIComponent : public BasicComponent {
  30.     
  31.   private:
  32.     
  33.     // Interface between XmNdestroyCallback and this class
  34.     
  35.     static void widgetDestroyedCallback ( Widget, 
  36.                      XtPointer, 
  37.                      XtPointer );
  38.     
  39.   protected:
  40.     
  41.     // Protect constructor to prevent direct instantiation
  42.     
  43.     UIComponent ( const char * );
  44.     
  45.     void installDestroyHandler(); // Easy hook for derived classes
  46.     
  47.     // Called by widgetDestroyedCallback() if base widget is destroyed
  48.     
  49.     virtual void widgetDestroyed(); 
  50.     
  51.     // Loads component's default resources into database
  52.     
  53.     void setDefaultResources ( const Widget , const String *);
  54.     
  55.     // Retrieve resources for this clsss from the resource manager
  56.     
  57.     void getResources ( const XtResourceList, const int );
  58.     
  59.   public:
  60.     
  61.     virtual ~UIComponent();  // Destructor
  62.     
  63.     // Manage the entire widget subtree represented
  64.     // by this component. Overrides BasicComponent method
  65.     
  66.     virtual void manage();
  67.     
  68.     // Public access functions
  69.     
  70.     virtual const char *const className() { return "UIComponent"; }
  71. };
  72.  
  73. #endif
  74.